/**
 * @Author: lifuzhao
 * @Date: 2019-08-06
 * @Project: shop_cms
 */
import fn from '../../plugins/fn'

export default function (target, name, descriptor) {
  const method = descriptor.value;
  let ret
  descriptor.value = (...args) => {
    const to = args[0]
    fn.setTitle(to.meta && to.meta.title)
    ret = method.apply(target, args)
    return ret
  }
  return descriptor
}
